<template>
  <div>
    <van-button type="primary">主要按钮</van-button>
  </div>
</template>

<script>
export default {
  beforeRouteEnter (to, from, next) {
    // console.log(from)
    if (localStorage.getItem('token')) {
      next()
    } else {
      next({
        path: '/login',
        query: { aaa: to.fullPath }
      })
    }
  }
}
</script>
